package com.codewsq;

import java.util.Arrays;

public class 冒泡排序 {

    public static void main(String[] args) {

        int[] nums = {23, 45, 756, 76, 3, 234, 43, 656, 34, 1, 43, 687, 76};


        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = 0; j < nums.length - 1 - i; j++) {
                if (nums[j] > nums[j + 1]) {
                    int temp = nums[j];
                    nums[j] = nums[j + 1];
                    nums[j + 1] = temp;
                }
            }
        }
        System.out.println(nums);

        System.out.println(Arrays.toString(nums));
    }
}
